﻿using RgUtility.Orm;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;


namespace WanCommon
{
    /// <summary>
    /// 数据访问工厂
    /// </summary>
    public class DbFactory
    {
        private static string connctionStrng = System.Configuration.ConfigurationManager.ConnectionStrings["conn"].ConnectionString;
        /// <summary>
        /// 返回强类型数据实体
        /// Remove()带入的内容请使用外键查询不要使用自动关联实体集合。
        /// </summary>
        /// <returns></returns>
        public static DbContext GetDb()
        {
            return new RgUtility.Orm.DbContext(connctionStrng);
        }
    }
}
